package com.csj.DesignPattern.template;

public class Dispatch {
    public static void main(String[] args) {
        Animal animal = new Animal();
        Animal dog = new Dog();
        Execute execute = new Execute();
        execute.execute(animal);
        execute.execute(dog);
    }
}

class Animal {
}
class Dog extends Animal{
}

class Execute {
    public void execute(Animal animal) {
        System.out.println(animal);
        System.out.println("Animal");
    }

    public void execute(Dog dog) {
        System.out.println("Dog");
    }
}
